package com.qqtech.qquan.pub.model;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.enums.BizzLevel1Enum;
import com.qqtech.core.common.enums.BizzLevel2Enum;
import com.qqtech.core.common.util.StringUtil;

@SuppressWarnings("serial")
public class PubCommentVo extends PubComment{
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}
	
	/**名称**/
	private java.lang.String creatorName;
	/**头像**/
	private java.lang.String creatorImg;
	/**是否被回复**/
	private java.lang.Boolean beCommented;
	/**被回复的人**/
	private java.lang.String beCommentedName;
	/**被回复的内容**/
	private java.lang.String beCommentedContent;
	/** 评论类型对应的业务标题 */
	private java.lang.String bizzTitle;
	/** 被评论业务的图片多个以;号分开 */
	private java.lang.String bizzImg;
	
	/**被评论业务内容（话题、大喇叭）的发布人-名称**/
	private java.lang.String beUserName;
	/**被评论业务内容（话题、大喇叭）的发布人-img**/
	private java.lang.String beUserImg;

	
	public java.lang.String getCreatorName() {
		return creatorName;
	}
	public void setCreatorName(java.lang.String creatorName) {
		this.creatorName = creatorName;
	}
	public java.lang.String getCreatorImg() {
		return creatorImg;
	}
	public void setCreatorImg(java.lang.String creatorImg) {
		this.creatorImg = creatorImg;
	}
	public java.lang.String getBeCommentedName() {
		return beCommentedName;
	}
	public void setBeCommentedName(java.lang.String beCommentedName) {
		this.beCommentedName = beCommentedName;
	}
	public java.lang.String getBeCommentedContent() {
		return beCommentedContent;
	}
	public void setBeCommentedContent(java.lang.String beCommentedContent) {
		this.beCommentedContent = beCommentedContent;
	}
	public java.lang.Boolean getBeCommented() {
		return beCommented;
	}
	public void setBeCommented(java.lang.Boolean beCommented) {
		this.beCommented = beCommented;
	}

	/**
	 * 评论人头像全URL
	 * example: http://192.168.1.xxx:8080/circle/1.png
	 * @return
	 */
	public java.lang.String getFullCreatorImg() {
		if(StringUtil.isBlank(this.getCreatorImg())){
			return "";
		}else if(this.getCreatorImg().indexOf("source://")>-1){
			return this.getCreatorImg();
		} else{
			return super.getFileDomain()+""+this.getCreatorImg();
		}
	}
	
	/**
	 * 被评论业务创建人头象全url
	 * @return
	 */
	public java.lang.String getBeUserFullImg() {
		if(StringUtil.isBlank(this.getBeUserImg())){
			return "";
		}else if(this.getBeUserImg().indexOf("source://")>-1){
			return this.getBeUserImg();
		} else{
			return super.getFileDomain()+""+this.getBeUserImg();
		}
	}
	
	public String getPathImgs() {
		if (StringUtil.isBlank(this.getBizzImg())) {
			return "";
		}
		String filePath = ";" + this.getFileDomain();
		String pathImgs = this.getBizzImg().replaceAll(";", filePath);
		return this.getFileDomain() + pathImgs;
	}
	
	/** 是否显示图片 **/
	public boolean getIsShowImg() {
		if (StringUtils.isNotBlank(this.getBizzImg())) {
			return true;
		} else {
			return false;
		}
	}
	
	public java.lang.String getBizzTitle() {
		return bizzTitle;
	}
	public void setBizzTitle(java.lang.String bizzTitle) {
		this.bizzTitle = bizzTitle;
	}

	
	/** 评论类型:AA-友事;BA-圈子话题;CA-社区大喇叭;EA-家庭幸福窝窝 */
	public String getBizzTypeName(){
		if(getBizzType().equalsIgnoreCase(BizzLevel2Enum.CIRCLE_TOPIC.getCode())){
			return "【圈子话题】";
		}else if(getBizzType().equalsIgnoreCase(BizzLevel2Enum.USER_TOPIC.getCode())){
			return "【友事】";
		}else if(getBizzType().equalsIgnoreCase(BizzLevel2Enum.COMMUNITY_MESSAGE.getCode())){
			return "【社区大喇叭】";
		}else if(getBizzType().equalsIgnoreCase(BizzLevel2Enum.HOME_MESSAGE.getCode())){
			return "【家庭幸福窝窝】";
		}else if(getBizzType().equalsIgnoreCase(BizzLevel1Enum.ACTIVITY.getCode())){
			return "【活动】";
		}else{
			return "";
		}
	}
	public java.lang.String getBeUserName() {
		return beUserName;
	}
	public void setBeUserName(java.lang.String beUserName) {
		this.beUserName = beUserName;
	}
	public java.lang.String getBeUserImg() {
		return beUserImg;
	}
	public void setBeUserImg(java.lang.String beUserImg) {
		this.beUserImg = beUserImg;
	}
	public java.lang.String getBizzImg() {
		return bizzImg;
	}
	public void setBizzImg(java.lang.String bizzImg) {
		this.bizzImg = bizzImg;
	}
}